This invention relates to a data transfer system, and more particularly to a system for directly transferring data between data memory and input-output devices in an apparatus controlled by a von-Neumann-type microprocessor.
Microprocessors control many types of electronic office equipment, industrial equipment, and household appliances. A microprocessor typically has separate program and data memories, and is connected to various input/output (I/O) devices such as sensors, indicators, and external memory devices.
Most microprocessors are of the von-Neumann type, which fetch and execute Instructions from program memory sequentially, one at a time. The instructions direct the microprocessor to carry out arithmetic and logic operations and perform data transfers. A common processing pattern is to transfer data from I/O devices into data memory, perform operations on the data, then transfer the results from data memory to I/O devices. The transfers take place on a set of buses, controlled by the microprocessor, over which the microprocessor, program memory, data memory, and I/O devices are interconnected.
One prior-art method of transferring data between I/O devices and data memory uses the microprocessor as an intermediary. To transfer data from an I/O device to data memory, for example, the microprocessor first reads the data from the I/O device into an internal register, then writes the data from the internal register to data memory. Transfers in the reverse direction are carried out similarly.
A disadvantage of this method is that it requires two instructions, one to effect the transfer between the microprocessor and the I/O device, and another to effect the transfer between the microprocessor and data memory. Besides making programs unnecessarily long, the use of two instructions risks the occurrence of an interrupt between the instructions. If an interrupt occurs, an interrupt-handling routine will be executed between the two parts of the data transfer, causing a considerable delay. In a transfer of data from a sensor device to data memory, for example, the delay can mean that by the the the sensor data is stored in data memory for processing, it no longer reflects the current condition sensed by the sensor.
Another method of transferring data between an I/O device and data memory is known as direct memory access (DMA). This method is frequently used for transferring large quantities of data between data memory and an external memory device. In a DMA transfer, the microprocessor notifies a DMA controller (DMAC) of the addresses between which the transfer is to take place and the quantity of data to be transferred, then gives control of the buses to the DMAC. The DMAC transfers the data between the I/O device and data memory directly, without intermediate storage in a register.
A problem with this method is that during the DMA transfer, since the microprocessor does not have control of the buses, It cannot communicate with the data memory or I/O devices, or even fetch Instructions from program memory. The microprocessor must therefore halt until the DMA transfer is completed, which is obviously an inefficient method of operation.